package cn.jnetty.ioc.definition;
import cn.jnetty.api.annotation.JEnableExcel;
import cn.jnetty.utils.create.excel.ExcelUtils;

import java.lang.annotation.Annotation;

/**
 * @author 猪哥亮
 * @email 1030681978@qq.com
 * @date 2020/5/6 11:48
 * 描述：
 */
public class JEnableExcelBeanDefinition  extends JDefaultBeanDefinition {
    public JEnableExcelBeanDefinition(Annotation annotation, Class<?> clazz) {
        super(annotation, clazz);
        init();
    }

    @Override
    protected void init() {
        JEnableExcel excel = (JEnableExcel) annotation;
        if (excel == null) {
            return;
        }
        try {
            ExcelUtils.read(excel.value());
        } catch (Exception e) {
            log.error("excel数据读取异常",e);
        }
    }
}
